home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / LISP Related / HyperDesign.Plastics / dca.p < prev    next >
Encoding:
Text File  |  1991-01-28  |  4.3 KB  |  280 lines  |  [TEXT/AAIS]

  1. rule(analyze_design(A,B),
  2.  and(
  3.   bagof(C,entity(C),D),
  4.   totalmatch(D,D,B,E,A))).
  5.  
  6.  
  7. rule(attribute(A,B,C),
  8.  and(
  9.   attribute_data(A,B,C,D),
  10.   provable(A,D))).
  11.  
  12.  
  13. rule(bestinfo(nil,cons(0.500000,cons(cons(cons(unknown,nil),nil),nil))),
  14.  true).
  15.  
  16. rule(bestinfo(cons(A,B),C),
  17.  and(
  18.   bestinfo(B,D),
  19.   moreinfo(A,D,C))).
  20.  
  21.  
  22. rule(dca,
  23.  and(
  24.   analyze_design(A,B),
  25.   and(
  26.    write('matchindex = '),
  27.    and(
  28.     write(B),
  29.     and(
  30.      nl,
  31.      print_reasons(A)))))).
  32.  
  33.  
  34. rule(dca_dfim(A),
  35.  and(
  36.   analyze_design(B,A),
  37.   print_dfim(B))).
  38.  
  39.  
  40. rule(entity(component(A)),
  41.  component(A)).
  42.  
  43. rule(entity(feature(A,B,C)),
  44.  feature(A,B,C)).
  45.  
  46.  
  47. rule(matchcoefaux(A,B,C,cons(cons(D,cons(E,nil)),nil)),
  48.  and(
  49.   c_data(D,F,G,H,I,E),
  50.   and(
  51.    univ(F,cons(J,cons(K,L))),
  52.    and(
  53.     or(
  54.      and(
  55.       =(A,F),
  56.       =(M,A)),
  57.      or(
  58.       and(
  59.        =(J,component_set),
  60.        and(
  61.         univ(A,cons(N,cons(O,P))),
  62.         and(
  63.          mymember(O,cons(K,L)),
  64.          =(M,A)))),
  65.       and(
  66.        =(J,feature_set),
  67.        and(
  68.         mymember(A,cons(K,L)),
  69.         and(
  70.          cut,
  71.          =(M,A)))))),
  72.     and(
  73.      provable(M,I),
  74.      translate(G,C)))))).
  75.  
  76. rule(matchcoefaux(A,B,0.500000,cons(cons(unknown,nil),nil)),
  77.  true).
  78.  
  79.  
  80. rule(moreinfo(cons(A,cons(B,nil)),C,C),
  81.  and(
  82.   =(A,0.500000),
  83.   cut)).
  84.  
  85. rule(moreinfo(A,cons(B,cons(C,nil)),A),
  86.  and(
  87.   =(B,0.500000),
  88.   cut)).
  89.  
  90. rule(moreinfo(cons(A,cons(B,nil)),cons(C,cons(D,nil)),cons(A,cons(E,nil))),
  91.  and(
  92.   @=<(A,C),
  93.   and(
  94.    @<(A,0.500000),
  95.    and(
  96.     union(B,D,E),
  97.     cut)))).
  98.  
  99. rule(moreinfo(cons(A,cons(B,nil)),cons(C,cons(D,nil)),cons(C,cons(E,nil))),
  100.  and(
  101.   @<(C,A),
  102.   and(
  103.    @<(C,0.500000),
  104.    and(
  105.     union(D,B,E),
  106.     cut)))).
  107.  
  108. rule(moreinfo(cons(A,cons(B,nil)),cons(C,cons(D,nil)),cons(C,cons(E,nil))),
  109.  and(
  110.   @=<(A,C),
  111.   and(
  112.    @>(A,0.500000),
  113.    and(
  114.     union(D,B,E),
  115.     cut)))).
  116.  
  117. rule(moreinfo(cons(A,cons(B,nil)),cons(C,cons(D,nil)),cons(A,cons(E,nil))),
  118.  and(
  119.   @<(C,A),
  120.   and(
  121.    @>(C,0.500000),
  122.    union(B,D,E)))).
  123.  
  124.  
  125. rule(mymember(A,cons(A,B)),
  126.  true).
  127.  
  128. rule(mymember(A,cons(B,C)),
  129.  mymember(A,C)).
  130.  
  131.  
  132. rule(print_dfim(nil),
  133.  true).
  134.  
  135. rule(print_dfim(cons(cons(unknown,nil),nil)),
  136.  write(' no c_data matched')).
  137.  
  138. rule(print_dfim(cons(cons(A,cons(B,nil)),C)),
  139.  and(
  140.   c_data(A,D,E,F,G,H),
  141.   and(
  142.    write(A),
  143.    and(
  144.     write('   rating = '),
  145.     and(
  146.      write(E),
  147.      and(
  148.       write('    entity = '),
  149.       and(
  150.        write(B),
  151.        and(
  152.         nl,
  153.         print_dfim(C))))))))).
  154.  
  155.  
  156. rule(print_reasons(nil),
  157.  and(
  158.   write('That is it'),
  159.   nl)).
  160.  
  161. rule(print_reasons(cons(cons(A,nil),B)),
  162.  and(
  163.   c_data(A,C,D,E,F,G),
  164.   and(
  165.    write('cbk_id = '),
  166.    and(
  167.     write(A),
  168.     and(
  169.      nl,
  170.      and(
  171.       write('   relevant entities = '),
  172.       and(
  173.        write(C),
  174.        and(
  175.         nl,
  176.         and(
  177.          write('   rating = '),
  178.          and(
  179.           write(D),
  180.           and(
  181.            nl,
  182.            and(
  183.             write('   reason = '),
  184.             and(
  185.              write(E),
  186.              and(
  187.               nl,
  188.               and(
  189.                nl,
  190.                print_reasons(B)))))))))))))))).
  191.  
  192.  
  193. rule(provable(A,always),
  194.  and(
  195.   true,
  196.   cut)).
  197.  
  198. rule(provable(A,and(B,C)),
  199.  and(
  200.   provable(A,B),
  201.   and(
  202.    provable(A,C),
  203.    cut))).
  204.  
  205. rule(provable(A,not(B)),
  206.  and(
  207.   cut,
  208.   not(provable(A,B)))).
  209.  
  210. rule(provable(A,with_attribute(B,C)),
  211.  and(
  212.   attribute_data(B,C,D),
  213.   and(
  214.    cut,
  215.    provable(A,D)))).
  216.  
  217. rule(provable(A,with_attribute(B,C,D)),
  218.  and(
  219.   attribute_data(B,C,D,E),
  220.   and(
  221.    cut,
  222.    provable(B,E)))).
  223.  
  224. rule(provable(A,B),
  225.  and(
  226.   call(B),
  227.   cut)).
  228.  
  229.  
  230. rule(totalmatch(nil,A,9.999999e-5,0.500000,cons(unknown,nil)),
  231.  true).
  232.  
  233. rule(totalmatch(cons(A,B),C,D,E,F),
  234.  and(
  235.   totalmatch(B,C,G,H,I),
  236.   and(
  237.    bagof(cons(J,cons(K,nil)),matchcoefaux(A,C,J,K),L),
  238.    and(
  239.     bestinfo(L,cons(M,cons(N,nil))),
  240.     and(
  241.      moreinfo(cons(H,cons(I,nil)),cons(M,cons(N,nil)),cons(E,cons(F,nil))),
  242.      and(
  243.       utility(A,O),
  244.       and(
  245.        is(P,mul(M,O)),
  246.        is(D,add(P,G))))))))).
  247.  
  248.  
  249. rule(translate(excellent,1.001000),
  250.  true).
  251.  
  252. rule(translate(verygood,0.800000),
  253.  true).
  254.  
  255. rule(translate(good,0.600000),
  256.  true).
  257.  
  258. rule(translate(poor,0.400000),
  259.  true).
  260.  
  261. rule(translate(bad,0.200000),
  262.  true).
  263.  
  264. rule(translate(verybad,0.001000),
  265.  true).
  266.  
  267.  
  268. rule(union(nil,A,A),
  269.  true).
  270.  
  271. rule(union(cons(A,B),C,D),
  272.  and(
  273.   mymember(A,C),
  274.   union(B,C,D))).
  275.  
  276. rule(union(cons(A,B),C,cons(A,D)),
  277.  union(B,C,D)).
  278.  
  279.  
  280.